<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui" >
		    
	<p:growl id="msgs0" showDetail="true" />	
	<!-- 页面间参数传递 
	<h:panelGrid  columns="6" cellspacing="10" >
		<h:outputText value="附件类型："  />
		<h:outputText value="#{uploadForType}"  style="color:blue;" />
		<h:outputText value="对象(合同/订单等)编号："  /> 
		<h:outputText value="#{uploadForId}"  style="color:blue;" /> 
		<h:outputText value="对象名称：" />
		<h:outputText value="#{uploadForName}"  style="color:blue;" />
	</h:panelGrid>
	-->
	<h:inputHidden value="#{uploadForType}" binding="#{attachUploadMB.uploadForTypeInput}"/>
	<h:inputHidden value="#{uploadForId}" binding="#{attachUploadMB.uploadForIdInput}"/>
	<h:inputHidden value="#{uploadForName}" binding="#{attachUploadMB.uploadForNameInput}"/>

	<p:panel id="panelUpload" style="margin-bottom:5px" >
		<h:panelGrid  columns="4" cellspacing="10" >
		<h:panelGroup>
			<p:fileUpload fileUploadListener="#{attachUploadMB.handleFileUpload}"
				mode="advanced" dragDropSupport="false"
				label="附件选择" uploadLabel="文件上传" cancelLabel="取消上传"						
				update=":frmAttach:panelUpload"  sizeLimit="10000000" fileLimit="10"
				allowTypes="/(\.|\/)(gif|jpe?g|png|xml|pdf)$/" invalidFileMessage="不支持的文件类型"/>
			<h:outputText value="【附件上传信息】" />
			<h:outputText id="upresult" value="成功上传附件: #{attchUploadMB.uploadedFile} " style="color:blue;" />
		</h:panelGroup>
	
		<img src="#{request.contextPath}/#{attachUploadMB.uploadedFileImage}" alt="图片显示"
			style="width:200px;height:120px;" title="#{attachUploadMB.uploadedFile}" />
		
		</h:panelGrid>

	</p:panel>
	
</ui:composition>
